package aware.common.action;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.interceptor.ServletRequestAware;

import com.opensymphony.xwork2.ActionSupport;

import aware.common.dp.ViewDP;
import aware.common.dto.HeaderLink;

public class ViewAction extends ActionSupport implements ServletRequestAware{
	/**
	 * 
	 */
	private static final long serialVersionUID = -1999732178664465426L;
	private HttpServletRequest request;
	private String userID;
	private String headerLinkID;
	private String sideLinkID;
	private ArrayList<HeaderLink> modules;
	private ArrayList<HeaderLink> links;
	public ArrayList<HeaderLink> getModules() {
		return modules;
	}

	public void setModules(ArrayList<HeaderLink> modules) {
		this.modules = modules;
	}

	public String viewPage() {
		ViewDP.setModuleNames(this);
		
		
		request.setAttribute("listOfLinks", modules);
		return "viewPage";
	}

	@Override
	public void setServletRequest(HttpServletRequest request) {
		System.out.println("Hello!");
		this.request=request;
		
	}

	public String getUserID() {
		return userID;
	}

	public void setUserID(String userID) {
		this.userID = userID;
	}

	public String getHeaderLinkID() {
		return headerLinkID;
	}

	public void setHeaderLinkID(String headerLinkID) {
		this.headerLinkID = headerLinkID;
	}

	public String getSideLinkID() {
		return sideLinkID;
	}

	public void setSideLinkID(String sideLinkID) {
		this.sideLinkID = sideLinkID;
	}

	public ArrayList<HeaderLink> getLinks() {
		return links;
	}

	public void setLinks(ArrayList<HeaderLink> links) {
		this.links = links;
	}
}
